#ifndef __PLAYER_ENTITY_STATES_HPP
#define __PLAYER_ENTITY_STATES_HPP

#include <vector>
#include "../BaseState.hpp"
#include "PlayerEntityStateNames.hpp"
#include "../Particles/BaseEmitter.hpp"

class AnimatedSprite;
class PlayerEntity;
class MMessage;

class PlayerListen : public BaseState<PlayerEntity, PlayerEntityStateName>
{
public:
	PlayerListen() { m_stateName = PLESN_LISTEN; }

	void beginState(PlayerEntity*);
	void updateState(PlayerEntity*, clock_t);
	void endState(PlayerEntity*);
	void handleMessage(PlayerEntity*, MMessage* pMsg);
};

class PlayerIdle : public BaseState<PlayerEntity, PlayerEntityStateName>
{
public:
	PlayerIdle() { m_stateName = PLESN_IDLE; }
	//~HostileIdle();

	void beginState(PlayerEntity*);
	void updateState(PlayerEntity*, clock_t);
	void endState(PlayerEntity*);
	void handleMessage(PlayerEntity*, MMessage* pMsg) {};
};

class PlayerMove : public BaseState<PlayerEntity, PlayerEntityStateName>
{
public:
	PlayerMove() { m_stateName = PLESN_MOVE; }
	//~HostileMove();

	void beginState(PlayerEntity*);
	void updateState(PlayerEntity*, clock_t);
	void endState(PlayerEntity*);
	void handleMessage(PlayerEntity*, MMessage* pMsg) {};
};

class PlayerMoveLeft : public BaseState<PlayerEntity, PlayerEntityStateName>
{
public:
	PlayerMoveLeft() { m_stateName = PLESN_MOVE_LEFT; }
	//~HostileMove();

	void beginState(PlayerEntity*);
	void updateState(PlayerEntity*, clock_t);
	void endState(PlayerEntity*);
	void handleMessage(PlayerEntity*, MMessage* pMsg) {};

private:
	float m_fAccelFx;
	float m_fCurrAccel;
	float m_fCurrRotAngle;
	float m_fMaxRot;
};

class PlayerMoveRight : public BaseState<PlayerEntity, PlayerEntityStateName>
{
public:
	PlayerMoveRight() { m_stateName = PLESN_MOVE_RIGHT; }
	//~HostileMove();

	void beginState(PlayerEntity*);
	void updateState(PlayerEntity*, clock_t);
	void endState(PlayerEntity*);
	void handleMessage(PlayerEntity*, MMessage* pMsg) {};

private:
	float m_fAccelFx;
	float m_fCurrAccel;
	float m_fCurrRotAngle;
	float m_fMaxRot;
};

class PlayerAttack : public BaseState<PlayerEntity, PlayerEntityStateName>
{
public:
	PlayerAttack() { m_stateName = PLESN_ATTACK; }
	//~HostileAttack();

	void beginState(PlayerEntity*);
	void updateState(PlayerEntity*, clock_t);
	void endState(PlayerEntity*);
	void handleMessage(PlayerEntity*, MMessage* pMsg) {};

private:
	AnimatedSprite*    m_pGunfire;
	AnimatedSprite*    m_pBullets;
	int                m_iCooldown;
	std::vector<int>*  m_pVec;
};

class PlayerExplode : public BaseState<PlayerEntity, PlayerEntityStateName>
{
public:
	PlayerExplode() { m_stateName = PLESN_EXPLODE; }
	~PlayerExplode();

	void beginState(PlayerEntity*);
	void updateState(PlayerEntity*, clock_t);
	void endState(PlayerEntity*);
	void handleMessage(PlayerEntity*, MMessage* pMsg) {};

private:
	AnimatedSprite* m_pExplodeAnim;
};

class PlayerDie : public BaseState<PlayerEntity, PlayerEntityStateName>
{
public:
	PlayerDie() { m_stateName = PLESN_DIE; m_pExplosionEmitter = 0;}
	~PlayerDie();

	void beginState(PlayerEntity*);
	void updateState(PlayerEntity*, clock_t);
	void endState(PlayerEntity*);
	void handleMessage(PlayerEntity*, MMessage* pMsg) {};

private:
	BaseEmitter* m_pExplosionEmitter;
};

#endif //__PLAYER_ENTITY_STATES_HPP

//EOF
